package service2;

import beans2.Patient;
import db2.PatientDao;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Patientquene {
    public ArrayList<Patient> getAllRecord(String DoctorID){//获取患者队列
        PatientDao patientDao=new PatientDao();
        ArrayList<Patient>list=patientDao.getallRecord(DoctorID);
        Collections.sort(list, new Comparator<Patient>() {
            @Override
            public int compare(Patient o1, Patient o2) {
                return o1.getOrder()- o2.getOrder();
            }
        });
        return list;
    }
}
